//1.设计一个函数，用来求出多个数据的平均值并返回
#include<stdio.h>
float average(float a[],int n)
{
	float sum = 0,aver;
	for(int i = 0; i < n; i++)
	{
		sum += a[i];
	}
	aver = sum / n;
	return aver;
}
int main()
{
	float a[] = {12.1,12.5,12.8,48.0,25.1,36.8};
	int n = sizeof a / sizeof a[0];
	printf("平均值为%f\n",average(a,n));
	return 0;
}

